
import Router from 'vue-router'
// import Tab from '@/components/tab/tab'
import Index from '@/page/index'
import Details from '@/page/details'
import Register from '@/page/register'
import FindPhoto from '@/page/findPhoto'

const routes = [
  {  //登录
    path: '/',
    redirect: 'Index',
    meta: {
      title: "项目案例"
      },
    // component: Index
  },
  {
    path: '/index',
    name: 'Index',
    meta: {
      title: "项目案例"
      },
    component: Index
  },
 
  {
    path: '/details',
    name: 'Details',
    meta: {
      title: "项目案例"
      },
    component: Details
  },
  {
    path: '/register',
    name: 'Register',
    meta: {
      title: "项目案例"
      },
    component: Register
  },

  {
    path: '/findPhoto',
    name: 'FindPhoto',
    meta: {
      title: "查看大图"
      },
    component: FindPhoto
  },



]
  
  const router = new Router({
  mode: 'hash',
  routes: routes,
  // scrollBehavior (to, from, savedPosition) {

  //   return { x: 0, y: 0 }
    
  //   }
  })
  
  router.beforeEach((to, from, next) => {
  if (to.meta.title) {
  document.title = to.meta.title
  }
  next();
  })

  export default router

